﻿using System;

namespace SoldiHive.Model
{
	[Serializable]
	public abstract class Entity
	{
		protected string Key { get; set; }

		public override bool Equals(object obj)
		{
			if (!(obj is Entity) || obj == null)
			{
				return false;
			}

			var company = obj as Entity;

			return string.Equals(this.Key, company.Key);
		}

		public override int GetHashCode()
		{
			return this.Key.GetHashCode();
		}
	}
}
